home *** CD-ROM | disk | FTP | other *** search
- Path: alc.ping.de!chn
- From: chn@alc.ping.de (Christian Neise)
- Newsgroups: comp.lang.c++
- Subject: Copying StdInput to StdOuput
- Date: 03 Jan 1996 09:09:05 GMT
- Organization: Christian's Linux Private Site
- Distribution: world
- Message-ID: <CHN.96Jan3100905@alc.alc.ping.de>
- NNTP-Posting-Host: alc.ping.de
-
-
- Hello!
-
- Sorry for this newbie-question:
-
- I want to write a filterprogramm under linux, which copies the
- modified standardinput to standardouput.
-
- I tried:
-
- #include <iostream.h>
-
- void main(){
- char buf[200];
- while (!cin.eof())
- { cin >> buf; // or: cin.get(buf, 200, '\n');
- cout << buf;
- }
- }
-
- I compiled this as test and tried: cat AnyTextfile | test
- and I expected to see AnyTextfile on the screen. But it
- didn't work.
-
- What's the problem?
-
- Thanks in advance for any help!
-
- Ciao,
- Christian.
-
-
-
-
- --
- Christian Neise
- ---------------
- email: chn@alc.ping.de phone: +49 - 231 - 751 95 22
- pgp-fingerprint: DE B0 C8 EF 42 44 4F 50 2C 2E DC 19 F5 71 65 83
-